# This file is part of BlackArch Linux ( http://blackarch.org ).
# See COPYING for license details.

pkgname=jok3r
pkgver=447.0761996
pkgrel=8
pkgdesc='Network and Web Pentest Framework.'
arch=('any')
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner' 'blackarch-fuzzer' 'blackarch-networking')
url='https://github.com/koutto/jok3r'
license=('GPL3')
depends=('python-argparse' 'python-blessed' 'python-beautifulsoup4'
         'python-cmd2' 'python-colorama' 'python-colored' 'python-colorlog'
         'python-enlighten' 'python-humanfriendly' 'python-prettytable'
         'python-python-libnmap' 'python-regex' 'python-requests' 'python-six'
         'python-sqlalchemy-utils' 'python-sqlalchemy' 'python-urllib3'
         'python-pillow' 'python-ansi2html' 'python-selenium' 'python-tld'
         'python-shodan')
makedepends=('git')
source=("git+https://github.com/koutto/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname/"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

